import dotenv from 'dotenv';
dotenv.config();

const config = {
  // 服务器配置
  server: {
    port: process.env.PORT || 3002,
    env: process.env.NODE_ENV || 'development'
  },

  // 数据库配置
  database: {
    uri: process.env.MONGODB_URI || 'mongodb://localhost:27017/zhihuiyun',
    options: {
      useNewUrlParser: true,
      useUnifiedTopology: true
    }
  },

  // JWT配置
  jwt: {
    secret: process.env.JWT_SECRET || 'your-secret-key',
    expiresIn: '24h'
  },

  // Agora配置
  agora: {
    appId: '94be56019f994107864c6cd7d19fe8b6',
    appCertificate: 'dad7d90a0fa94ff39b1660c8624fef22',
    expirationTime: 3600
  },

  // 短信服务配置
  sms: {
    provider: 'aliyun',
    aliyun: {
      accessKeyId: 'your-aliyun-access-key-id',
      accessKeySecret: 'your-aliyun-access-key-secret',
      signName: 'your-sms-sign-name',
      templateCode: 'your-sms-template-code'
    }
  },

  signaling: {
    port: 3001
  },

  api: {
    baseUrl: process.env.API_BASE_URL || 'http://localhost:3002',
    timeout: 10000,
    retryAttempts: 3
  },

  // 日志配置
  logging: {
    level: process.env.LOG_LEVEL || 'info',
    format: 'combined'
  }
};

export default config; 